<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">
	<span class="color_red">*</span>主要完成人情况
</div>
<table id="zh_persons" border="0" cellspacing="0" cellpadding="0"
	class="table01">
	<thead>
		<tr>
			<th width="7%">选择</th>
			<th nowrap>序号</th>
			<th width="11%">姓名</th>
			<th width="13%">电子邮件</th>
			<th width="12%">联系电话</th>
			<th width="17%">工作单位</th>
			<th width="11%">学位</th>
			<th width="12%">职务</th>
			<th width="12%">职称</th>
		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display: none">
			<td align="center" width="50px">
				<input type="radio" name="sel_zh_persons" onclick="setSubmitPsn3()"/>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]@seq_no">[index]</span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|basic_info|zh_name" label="姓名"></span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|contact|email" label="电子邮箱"></span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|contact|tel_work" label="联系电话"></span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|basic_info|org_name" label="工作单位"></span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|basic_info|degree_name" 　label="学位"></span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|basic_info|position_2" 　label="职务"></span>
			</td>
			<td align="center">
				<span name="zh_persons|zh_person[0]|basic_info|prof_title_name" label="职称"></span>
			</td>
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|ethnicity_value" label="民族" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|ethnicity_name" label="民族" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|party" label="党派" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|birth_province" label="出生地" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|birth_city" label="出生地" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|overseas_value" label="国家(地区)" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|overseas_name" label="国家(地区)" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|org_code" label="工作单位 code" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|psn_post_code" label="邮政编码" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|degree_value" label="学位" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|graduate_college" label="毕业学校" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|home_address" label="家庭地址" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|home_phone" label="住宅电话" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|address" label="通讯地址" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|prof_title" label="职称" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|prof_title_value" label="职称" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|gender_value" label="性别" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|gender_name" label="性别 name" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|age" label="年龄" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|educate_value" label="文化程度" />
			<input type="hidden" name="zh_persons|zh_person[0]|researches" label="xml" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|card_type_value" label="证件类别" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|card_type_name" label="证件类别" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|card_code" label="身份证号" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|major" label="专业" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|speciality" label="专长" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|birthday" label="出生日期" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|graduation_date" label="毕业时间" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|graduation_time" label="毕业时间 time" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|educate_name" label="文化程度" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|foreign_type" label="外语语种" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|isyuansi_name" label="是否是院士" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|isyuansi_value" label="是否是院士 value" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|party_name" label="党派" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|party_value" label="党派 value" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|prj_startdate" label="本项目开始日期" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|prj_enddate" label="本项目结束日期" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|wcr_honour" label="完成人荣誉" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|wcr_honour_hidden" label="完成人荣誉2" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|wcr_creativity_contribute" label="创造性贡献" />
			<input type="hidden" name="zh_persons|zh_person[0]|basic_info|wcr_creativity_contribute_hidden" label="创造性贡献2" />
		</tr>
		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/zh_persons/zh_person" var="zh_person">
			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr>
				<td align="center" width="50px">
					<input type="radio" name="sel_zh_persons" onclick="setSubmitPsn3()" /> 
					<c:if test="${index==0}">
						<input type="hidden" id="submit_psn"
							name="zh_persons/zh_person[${flag}${index}]@submit_psn" value="1" />
						<input type="hidden"
							name="zh_persons/zh_person[${flag}${index}]/basic_info/psn_code"
							value="<x:out select="$zh_person/basic_info/psn_code" />" />
					</c:if>
				</td>
				<td align="center"><span
					name="zh_persons/zh_person[${flag}${index}]@seq_no">${index+1}</span>
				</td>
				<td align="center">
					<span class="required " label="姓名" name="zh_persons/zh_person[${flag}${index}]/basic_info/zh_name"> 
						<x:out select="$zh_person/basic_info/zh_name" />
					</span>
					<input type="hidden" class="required" label="性别" name="zh_persons/zh_person[${flag}${index}]/basic_info/gender_value"
						value="<x:out select="$zh_person/basic_info/gender_value" />" />
					<input type="hidden" class="" label="性别 name" name="zh_persons/zh_person[${flag}${index}]/basic_info/gender_name"
						value="<x:out select="$zh_person/basic_info/gender_name" />" />
					<input type="hidden" class="required" label="党派" name="zh_persons/zh_person[${flag}${index}]/basic_info/party"
						value="<x:out select="$zh_person/basic_info/party" />" />
					<input type="hidden" class="required" label="民族" name="zh_persons/zh_person[${flag}${index}]/basic_info/ethnicity_name"
						value="<x:out select="$zh_person/basic_info/ethnicity_name" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/ethnicity_value"
						value="<x:out select="$zh_person/basic_info/ethnicity_value" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/overseas_name"
						value="<x:out select="$zh_person/basic_info/overseas_name" />" />
					<input type="hidden" class="required" label="国家(地区)" name="zh_persons/zh_person[${flag}${index}]/basic_info/overseas_value"
						value="<x:out select="$zh_person/basic_info/overseas_value" />" />
					<input type="hidden" class="required" label="出生地-->省（自治区）" name="zh_persons/zh_person[${flag}${index}]/basic_info/birth_province"
						value="<x:out select="$zh_person/basic_info/birth_province" />" />
					<input type="hidden" class="required" label="出生地-->市（县）" name="zh_persons/zh_person[${flag}${index}]/basic_info/birth_city"
						value="<x:out select="$zh_person/basic_info/birth_city" />" /> 
					<input type="hidden" class="required" label="证件类型" name="zh_persons/zh_person[${flag}${index}]/basic_info/card_type_value"
						value="<x:out select="$zh_person/basic_info/card_type_value" />" />
					<input type="hidden" class="card " name="zh_persons/zh_person[${flag}${index}]/basic_info/card_type_name"
						value="<x:out select="$zh_person/basic_info/card_type_name" />" />
					<input type="hidden" class="required" label="身份证号码" name="zh_persons/zh_person[${flag}${index}]/basic_info/card_code"
						value="<x:out select="$zh_person/basic_info/card_code" />" /></td>
				<td align="center">
					<span class="required " label="电子邮箱" name="zh_persons/zh_person[${flag}${index}]/contact/email">
						<x:out select="$zh_person/contact/email" />
					</span>
				</td>
				<td align="center">
					<span class="required " label="联系电话" name="zh_persons/zh_person[${flag}${index}]/contact/tel_work">
						<x:out select="$zh_person/contact/tel_work" />
					</span>
				</td>
				<td align="center">
					<span class="required " label="工作单位" name="zh_persons/zh_person[${flag}${index}]/basic_info/org_name">
						<x:out select="$zh_person/basic_info/org_name" />
						<input type="hidden" class="" label="工作单位 code" name="zh_persons/zh_person[${flag}${index}]/basic_info/org_code"
						value="<x:out select="$zh_person/basic_info/org_code" />" />
					</span>
					<input type="hidden" class="required" label="出生日期" name="zh_persons/zh_person[${flag}${index}]/basic_info/birthday"
						value="<x:out select="$zh_person/basic_info/birthday" />" />
					<input type="hidden" class="required" label="住宅电话" name="zh_persons/zh_person[${flag}${index}]/basic_info/home_phone"
						value="<x:out select="$zh_person/basic_info/home_phone" />" />
					<input type="hidden" class="required" label="通讯地址" name="zh_persons/zh_person[${flag}${index}]/basic_info/address"
						value="<x:out select="$zh_person/basic_info/address" />" />
					<input type="hidden" class="required" label="出生地" name="zh_persons/zh_person[${flag}${index}]/basic_info/birth_area"
						value="<x:out select="$zh_person/basic_info/birth_area" />" />
					<input type="hidden" class="required" label="邮政编码" name="zh_persons/zh_person[${flag}${index}]/basic_info/psn_post_code"
						value="<x:out select="$zh_person/basic_info/psn_post_code" />" />
					<input type="hidden" class="required" label="文化程度" name="zh_persons/zh_person[${flag}${index}]/basic_info/educate_name"
						value="<x:out select="$zh_person/basic_info/educate_name" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/educate_value"
						value="<x:out select="$zh_person/basic_info/educate_value" />" />
					<input type="hidden" class="required" label="是否是院士" name="zh_persons/zh_person[${flag}${index}]/basic_info/isyuansi_name"
						value="<x:out select="$zh_person/basic_info/isyuansi_name" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/isyuansi_value"
						value="<x:out select="$zh_person/basic_info/isyuansi_value" />" />
					<input type="hidden" class="required" label="党派" name="zh_persons/zh_person[${flag}${index}]/basic_info/party_name"
						value="<x:out select="$zh_person/basic_info/party_name" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/party_value"
						value="<x:out select="$zh_person/basic_info/party_value" />" />
				</td>
				<td align="center">
					<span class="required " label="学位" name="zh_persons/zh_person[${flag}${index}]/basic_info/degree_name">
						<x:out select="$zh_person/basic_info/degree_name" /></span>
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/degree_value"
						value="<x:out select="$zh_person/basic_info/degree_value" />" /></td>
				<c:set var="pos">
					<x:out select="$zh_person/basic_info/position_2" />
				</c:set>
				<c:if test="${empty pos}">
					<c:set var="pos">
						<x:out
							select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/position" />
					</c:set>
				</c:if>
				<td align="center">
					<span class="required " label="职务" name="zh_persons/zh_person[${flag}${index}]/basic_info/position_2">${pos}</span>
				</td>
				<td align="center">
					<span class="required " label="职称" name="zh_persons/zh_person[${flag}${index}]/basic_info/prof_title_name">
						<x:out select="$zh_person/basic_info/prof_title_name" />
					<input type="hidden" label="职称" name="zh_persons/zh_person[${flag}${index}]/basic_info/prof_title"
						value="<x:out select="$zh_person/basic_info/prof_title" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/prof_title_value"
						value="<x:out select="$zh_person/basic_info/prof_title_value" />" />
					</span>
					<input type="hidden" class="required" label="专业" name="zh_persons/zh_person[${flag}${index}]/basic_info/major"
						value="<x:out select="$zh_person/basic_info/major" />" />
					<input type="hidden" class="required" label="专长" name="zh_persons/zh_person[${flag}${index}]/basic_info/speciality"
						value="<x:out select="$zh_person/basic_info/speciality" />" />
					<input type="hidden" label="毕业学校" name="zh_persons/zh_person[${flag}${index}]/basic_info/graduate_college"
						value="<x:out select="$zh_person/basic_info/graduate_college" />" />
					<input type="hidden" class="required" label="毕业时间" name="zh_persons/zh_person[${flag}${index}]/basic_info/graduation_date"
						value="<x:out select="$zh_person/basic_info/graduation_date" />" />
					<input type="hidden" class="" label="毕业时间 time" name="zh_persons/zh_person[${flag}${index}]/basic_info/graduation_time"
						value="<x:out select="$zh_person/basic_info/graduation_time" />" />
					<input type="hidden" class="required" label="外语语种" name="zh_persons/zh_person[${flag}${index}]/basic_info/foreign_type"
						value="<x:out select="$zh_person/basic_info/foreign_type" />" />
					<input type="hidden" class="required" label="熟练程度" name="zh_persons/zh_person[${flag}${index}]/basic_info/foreign_level_name"
						value="<x:out select="$zh_person/basic_info/foreign_level_name" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/foreign_level_value"
						value="<x:out select="$zh_person/basic_info/foreign_level_value" />" />
					<input type="hidden" class="required" label="参加本项目开始时间" name="zh_persons/zh_person[${flag}${index}]/basic_info/prj_startdate"
						value="<x:out select="$zh_person/basic_info/prj_startdate" />" />
					<input type="hidden" class="required" label="参加本项目结束时间" name="zh_persons/zh_person[${flag}${index}]/basic_info/prj_enddate"
						value="<x:out select="$zh_person/basic_info/prj_enddate" />" />
					<input type="hidden" class="required" label="家庭地址" name="zh_persons/zh_person[${flag}${index}]/basic_info/home_address"
						value="<x:out select="$zh_person/basic_info/home_address" />" />
					<input type="hidden" class="required" label="曾获奖励与荣誉称号情况" name="zh_persons/zh_person[${flag}${index}]/basic_info/wcr_honour"
						value="<x:out select="$zh_person/basic_info/wcr_honour" />" />
					<input type="hidden" class="" label="曾获奖励与荣誉称号情况2" name="zh_persons/zh_person[${flag}${index}]/basic_info/wcr_honour_hidden"
						value="<x:out select="$zh_person/basic_info/wcr_honour_hidden" />" />
					<input type="hidden" class="required" label="创造性贡献" name="zh_persons/zh_person[${flag}${index}]/basic_info/wcr_creativity_contribute"
						value="<x:out select="$zh_person/basic_info/wcr_creativity_contribute" />" />
					<input type="hidden" class="" label="创造性贡献2" name="zh_persons/zh_person[${flag}${index}]/basic_info/wcr_creativity_contribute_hidden"
						value="<x:out select="$zh_person/basic_info/wcr_creativity_contribute_hidden" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/basic_info/age"
						value="<x:out select="$zh_person/basic_info/age" />" />
					<input type="hidden" name="zh_persons/zh_person[${flag}${index}]/researches" label="xml" />
				</td>
			</tr>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
	</tbody>
</table>
<br />

<table border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td><input class="button_02" type="button" value="添加"
			onclick="if(checkTabLimit('zh_persons',30,'主要完成人最多只能填写30条')){addNewRow('zh_persons','${ctx}/proposal/2014/edit/dialog/orgInfoEdit_kxjstjs_dgzywcdw?parentTab=zh_persons&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','添加主要完成人');}try{top.resizeFrame();}catch(e){};">
			&nbsp; <input class="button_02" id="prev_psn" type="button"
			value="上移"
			onclick="movePrev('zh_persons','sel_zh_persons');setSubmitPsn3()">
			&nbsp; <input class="button_02" id="next_psn" type="button"
			value="下移"
			onclick="moveNext('zh_persons','sel_zh_persons');setSubmitPsn3()">
			&nbsp; <input class="button_02" id="zh_psnEdit" type="button"
			value="编辑"
			onclick="if(checkSubmitPsn('zh_persons'))editRow('zh_persons','${ctx}/proposal/2014/edit/dialog/orgInfoEdit_kxjstjs_dgzywcdw?parentTab=zh_persons&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','编辑主要完成人信息')">
			&nbsp; <input class="button_02" id="del_psn" type="button" value="删除"
			onclick="deleteSelectedRow2('zh_persons','完成人信息',1,'第一主要完成人不能被删除');"></td>
	</tr>

</table>




<script type="text/javascript">
function deleteSelectedRow2(tableId,message,nummin,warnMsg,selName){
	
	if(!selName)selName="";
	var tr=$("#"+tableId+" :radio[name*='"+selName+"']:checked").parents("tr");
	if(nummin==null)
		nummin=0;
	var length=tr.length;
	if(tr.length==0)
		tr=$("#"+tableId+" tr").filter(":last");
	else if(tr.length>1)
		tr=tr.first();

	if(tr.get(0).rowIndex-1==nummin){
		scmWarn(warnMsg);
		return false;
	} 
	if(length==0){
		deleteSucceeded
			scmWarn(irisNotes.delWarn2);
		
		return false;
	}
	  if(!confirm(messageTip.deleteTip+message+"？"))
		  return false;
	  tr.remove();
	  refreshRowINdex(tableId);
	  return true;
}



	/**
	 * 锁定申报人行的按钮
	 */

	/* 	$(document).ready(function() {

	 setSubmitPsn3();
	 }); */

	function checkSubmitPsn(tableId) {

		return true;

	}

	function setSubmitPsn3() {

	 	var tr = $("#zh_persons :radio:checked").parents("tr");
		
		

		/*
		if (tr.get(0).rowIndex - 1 == 1) {// 如果选择的是申报人
			$("#prev_psn").attr("disabled", "true").css("color", "#808080");
			$("#next_psn").attr("disabled", "true").css("color", "#808080");
			$("#del_psn").attr("disabled", "true").css("color", "#808080");

			//alert("申报人");

		} else if (tr.get(0).rowIndex - 1 == 2) {// 如果是申报书的下一行
			$("#prev_psn").attr("disabled", "true").css("color", "#808080");
			$("#next_psn").removeAttr("disabled").css("color", "#003366");
			$("#del_psn").removeAttr("disabled").css("color", "#003366");
			//alert("申报人下一行");
		} else {
			$("#prev_psn").removeAttr("disabled").css("color", "#003366");
			$("#next_psn").removeAttr("disabled").css("color", "#003366");
			$("#del_psn").removeAttr("disabled").css("color", "#003366");
			//alert("其他行");
		} */

	}

	function psnSynchro() {
		$("span[name$='fzr_psnname']").text(
				$("#zh_persons tr:eq(2)").find(
						"span[name$='basic_info/zh_name']").text());
		$("span[name$='fzr_tel']").text(
				$("#zh_persons tr:eq(2)").find(
						"input[name$='contact/tel_work']").val());
		$("span[name$='fzr_tel_work']").text(
				$("#zh_persons tr:eq(2)").find(
						"input[name$='contact/tel_work']").val());
		$("span[name$='fzr_mail']").text(
				$("#zh_persons tr:eq(2)").find("input[name$='contact/email']")
						.val());
	}

	function irisJqValEmpty2(obj, msg) {

		var sum = 0;
		obj.find(":input,textarea").each(function() {

			if ($(this).val() == '') {
				alert($(this).attr("name") + "  " + $(this).val());
				sum += 1;
			}
		});

		if (sum != 0)
			irisValaddMsg(msg);

	}
</script>



